﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WXYW.BLL;
using WXYW.Model;
using WXYW.DAL;

namespace WXYW
{
    public partial class CustomerFeedbackDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            long feedbackID = Convert.ToInt32(Request.QueryString[Constants.QUERTSTR_FEEDBACK_ID]);
            CustomerFeedbackService service = new CustomerFeedbackService();
            CustomerFeedbackMode model = service.GetCustomerFeedback(feedbackID);
            hfTimeLbl.Text = model.HFDate.ToString();
            hfResultLbl.Text = model.hfResult;
            hfStateLbl.Text = model.InfoState;
            hfFromLbl.Text = model.HFFrom;
            mydLbl.Text = model.myd;
            adviceTxtBox.Text = model.khAdvice;
            requireTxtBox.Text = model.khRequire;
            customerNameLbl.Text = model.CustomerName;
            serialNOLbl.Text = model.SerialNO;
            ApplicationService appliccationService = new ApplicationService();
            ApplicationForm form = appliccationService.GetApplicationFormByID(model.FormID);
            ViewApplicationLnk.Text = form.ApplicationCode;
            ViewApplicationLnk.PostBackUrl = string.Format("ApplicationDetail.aspx?{0}={1}&{2}={3}&BackType=3", Constants.QUERTSTR_FEEDBACK_ID, feedbackID,
                Constants.QUERYSTR_APPLICATION_ID, model.FormID);
        }

        protected void ViewApplicationLnk_Click(object sender, EventArgs e)
        {

        }
    }
}
